#include "DealBox.h"
#include "Widget.h"
#include "yyjson.h"

DealBox::DealBox()
{
    this->Instances.clear();
    this->Instances.push_back(new CandlestickChart(1));
}

void DealBox::Draw()
{
    ImGui::Begin("DealBox", NULL, ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoDocking);
    ImGui::BeginMenuBar();
    if (ImGui::BeginMenu("Add"))
    {
        if (ImGui::MenuItem("CandlestickChart"))
        {
            // Instances.push_back(new CandlestickChart());
        }
        ImGui::EndMenu();
    }
    ImGui::EndMenuBar();

    if (ImGui::Button("Quit"))
    {
        Application::Quit();
    }

    for (auto instance : Instances)
    {
        instance->Draw();
    }

    ImGui::End();
}